<%= will_filter_tag(@users) %>

<%= will_filter_table_tag(@users, :columns => [
   :id, 
   {:key => :name, 
	   :value => lambda{ |obj| 
		   if @users.wf_filter.column_sorted?(:last_name)
			   raw("<span style='font-weight:normal'>#{h(obj.first_name)} <strong>#{h(obj.last_name)}</strong></span>")
		   elsif @users.wf_filter.column_sorted?(:first_name)	
			   raw("<span style='font-weight:normal'><strong>#{h(obj.first_name)}</strong> #{h(obj.last_name)}</span>")
		   else
			   "#{obj.first_name} #{obj.last_name}"
		   end	
	  }, 
	  :title => lambda{ |filter| 
		  if filter.column_sorted?(:last_name)
    	  first_name_link = link_to("First Name", filter.to_params(:wf_order => :first_name, :wf_order_type => 'asc'), :title => "sort by first name ascending")
    	  last_name_link = link_to("Last Name", filter.to_params(:wf_order => :last_name, :wf_order_type => (filter.order_type == 'asc' ? 'desc' : 'asc')), 
    		                        :title => "sort by last name #{(filter.order_type == 'asc' ? 'descending' : 'ascending')}", 
    		                        :style=>'color:black;font-weight:bold')
    	
		   elsif filter.column_sorted?(:first_name)	
    	   last_name_link = link_to("Last Name", filter.to_params(:wf_order => :last_name, :wf_order_type => 'asc'), :title => "sort by last name ascending")
    	   first_name_link = link_to("First Name", filter.to_params(:wf_order => :first_name, :wf_order_type => (filter.order_type == 'asc' ? 'desc' : 'asc')), 
    		                        :title => "sort by first name #{(filter.order_type == 'asc' ? 'descending' : 'ascending')}", 
    		                        :style=>'color:black;font-weight:bold')
    	
		   else
         last_name_link = link_to("Last Name", filter.to_params(:wf_order => :last_name, :wf_order_type => 'asc'), :title => "sort by last name ascending")
    	   first_name_link = link_to("First Name", filter.to_params(:wf_order => :first_name, :wf_order_type => 'asc'), :title => "sort by first name ascending")
		   end	

  	   [first_name_link, last_name_link].join(' / ').html_safe
	  },
	  :sortable => true,
	  :sort_key => lambda{ |filter| filter.column_sorted?(:first_name) ? :first_name : :last_name}    	
  }, 
  [:birthday, :filterable => true],
  [:sex, {:title => 'Gender', :filterable => true}]
]) %>
